<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>设置密码</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/common.css"/>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
	</head>
	<body class="bg_ff">
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">设置密码</h1>
		</header>
		<div class="mui-content bg_ff">
		   <div class="padding_12 mg_top10">
			   	<div class="">
			   		<p class="color_00 bold mg_tb10">输入密码</p>
				   	<div class="tx_list">
				   		<input type="password" name="" id="password" value="" placeholder="请输入密码" />
				   		
				   	</div>
				   	
			   	</div>
			   	<div class="">
			   		<p class="color_00 bold mg_tb10">确认密码</p>
				   	<div class="tx_list">
				   		<input type="password" name="" id="repassword" value="" placeholder="请再次输入密码" />
				   	</div>
			   	</div>
			   	
			   	<p class="text-center mg_top40 width90"><a href="javascript:void(0);" class="big_btn" onclick="setpad()">提交</a></p>
		   </div>
		</div>
		<script src="js/mui.js"></script>
		<script src="js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init()
			
			//获取我的信息
			function setpad(){
				var password = $('#password').val()
				var repassword = $('#repassword').val()
				if(password ==repassword ){
					$.ajax({
					type:"post",
					url:urlcom + "user/updatePwd",
					async:true,
					dataType:'json',
					data:{
						userId:localStorage.getItem('userId'),
						password:$('#password').val()
					},
					success:function(res){
						
						if(res.code==0){
							
							msg('修改成功')
							setTimeout(function(){
								window.location.href = 'my.html'
							},1000)
							
							
							
						}else{
							msg(res.msg)
						}
		 			}
			     })
				}else{
					msg('两次输入的密码不一致')
				}
				
				
			}
		
			
		</script>
	</body>

</html>
